/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.employee.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.chlitina.store.common.persistence.BaseDao;
import com.chlitina.store.common.persistence.BaseDaoImpl;
import com.chlitina.store.modules.employee.entity.StoreBonusSettingCare;

/**
 * 手工护理提成设定DAO接口
 * 
 * @author liujiang
 * @version 2013-11-15
 */
public interface StoreBonusSettingCareDao extends
		StoreBonusSettingCareDaoCustom,
		CrudRepository<StoreBonusSettingCare, Long> {
	@Query("select cs.storeCare.id from StoreBonusSettingCare cs where cs.employee.id=?1 and cs.card_type=?2")
	public List<Long> getByCardType(Long employeeId, int card_type);

	@Modifying
	@Query("delete from StoreBonusSettingCare s  where s.employee.id=?1")
	public void deleteByEmployee(Long employeeId);

	@Query("from StoreBonusSettingCare cs where cs.store.id=?1 and cs.employee.id=?2 and cs.storeCare.id=?3 and cs.card_type=?4")
	public List<StoreBonusSettingCare> list(long storeID, long employeeId,
			long storeCare, int cardType);
}

/**
 * DAO自定义接口
 * 
 * @author liujiang
 */
interface StoreBonusSettingCareDaoCustom extends BaseDao<StoreBonusSettingCare> {

}

/**
 * DAO自定义接口实现
 * 
 * @author liujiang
 */
@Component
class StoreBonusSettingCareDaoImpl extends BaseDaoImpl<StoreBonusSettingCare>
		implements StoreBonusSettingCareDaoCustom {

}
